package com.fwixvye.controller;

import com.fwixvye.pojo.Result;
import com.fwixvye.service.RandomGenerationRelicsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/RandomGenerationOfHolyRelics")
public class RandomGenerationRelicsController {

    @Autowired
    RandomGenerationRelicsService randomGenerationRelicsService;

    @PostMapping("/conditionalGenerationOfRelics")
    public Result conditionalGenerationOfRelics(@RequestBody Map<String, Object> requestData) {
        String NUMposition = (String) requestData.get("NUMposition");
        String mainTerm = (String) requestData.get("mainTerm");
        Integer numberGenerated = (Integer) requestData.get("numberGenerated");



        return randomGenerationRelicsService.conditionalGenerationOfRelics(NUMposition,mainTerm,numberGenerated);
    }

}
